#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QButtonGroup>
#include <QDebug>
#include <QVariant>
#include <QKeyEvent>


QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Calculator : public QWidget
{
    Q_OBJECT

public:
    Calculator(QWidget *parent = nullptr);
    ~Calculator();

    void init(void);

public slots:
    void btn_checked(QAbstractButton *btn);


private:
    void keyPressEvent(QKeyEvent *event) override; //键盘按下事件

    Ui::Widget *ui;
    bool coiled;
    double val1;
    double val2;
    double result;
    QString opt;
};
#endif // WIDGET_H
